<?php
namespace app\madmin\model;
use think\Model;

/**
 * 订单商品模型类
 * @author  黄明杰 vx:HMJ125855
 * @version 20190201
 */
class MallFormsModel extends Model
{

    protected $name = 'MallForms';

    /**
     * 数据列表方法
     * @param   Array   $Where  查询条件
     * @param   String  $Field  查询字段
     * @param   Int     $Limit  每页条数
     * @param   Srting  $Order  查询排序
     * @return  Array
     */
    public function mList($Where = [], $Field = '*', $Limit = 15, $Order = 'forms_id DESC'){
        $Count = $this->mCount($Where);

        $Where['forms_del'] = 1;

        return $this->field($Field)->where($Where)->order($Order)->paginate($Limit, $Count, ['query'=>request()->param()]);
    }

    /**
     * 数据统计方法
     * @param   Array   $Where  查询条件
     * @return  Int
     */
    public function mCount($Where = []){
        $Where['forms_del'] = 1;

        return $this->where($Where)->count();
    }

}